package com.gxa.hotel.core.pojo.vo;

import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import com.gxa.hotel.core.group.LoginGroup;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class UserVO implements Serializable {
    //LoginGroup 表示只有在该分组的设置中才会开启非空校验
    @NotEmpty(message = "手机号不能为空",groups = LoginGroup.class)
    private String phone;
    @NotEmpty(message = "密码不能为空",groups = LoginGroup.class)
    private String pwd;
    private String name;
    private Integer points;
    //时区的选择:Asia/Shanghai 或者 GMT+8
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
//    @JsonSerialize(using = JsonSerializer.class)
    @JsonDeserialize(using = JsonDeserializer.class)
    private LocalDateTime regTime;
}
